const http = require("http");
const url = require("url");
const fs = require("fs");
const path = require("path");
const querystring = require("querystring");
http.createServer((req, res) => {
    let urlObj = new URL(req.url, "http://192.168.174.166:3000/");
    let pathName = urlObj.pathname;
    if (pathName == "/") {
        let fileContent = fs.readFileSync("./fankui.html");
        res.writeHead(200, { "Content-Type": "text/html;charset=utf8" });
        res.end(fileContent)
        let page = urlObj.origin + urlObj.search;
        console.log(page);
        page = url.parse(page).query;
        console.log(page);
        console.log(querystring.parse(page));
    }

}).listen(8080);